package com.zx.bean;


import java.util.List;

public class PageBean<T> {
    private long totalCount; //总条数   查数据库
    private int pageNum;  //页码       默认为1
    private int pageSize;  //每页条数   默认为6
    private int totalPage;  //总页码   (int)Math.ceil(totalCount * 1.0 / pageSize)
    private List<T> data;  //数据     查询数据库

    private int startPage;  //初始页码
    private int endPage; //末尾页码



    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPage() {
        return (int)Math.ceil(totalCount * 1.0 / pageSize);
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public int getStartPage() {
        return 1;
    }

    public void setStartPage(int startPage) {
        this.startPage = startPage;
    }

    public int getEndPage() {
        return (int)Math.ceil(totalCount * 1.0 / pageSize);
    }

    public void setEndPage(int endPage) {
        this.endPage = endPage;
    }
}
